

<%@ page import="Biblioteca.Reserva" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <g:if test="${tipo == 'Admin'}">
        	<meta name="layout" content="adminBiblioteca" />
        </g:if>
        <g:else>
        	<meta name="layout" content="usuarioBiblioteca" />
        </g:else>
        <g:set var="entityName" value="${message(code: 'reserva.label', default: 'Reserva')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${reservaInstance}">
            <div class="errors">
                <g:renderErrors bean="${reservaInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${reservaInstance?.id}" />
                <g:hiddenField name="version" value="${reservaInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="dataDevolucao"><g:message code="reserva.dataDevolucao.label" default="Data Devolucao" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: reservaInstance, field: 'dataDevolucao', 'errors')}">
                                    <g:datePicker name="dataDevolucao" precision="day" value="${reservaInstance?.dataDevolucao}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="dataRequisicao"><g:message code="reserva.dataRequisicao.label" default="Data Requisicao" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: reservaInstance, field: 'dataRequisicao', 'errors')}">
                                    <g:datePicker name="dataRequisicao" precision="day" value="${reservaInstance?.dataRequisicao}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="dataReserva"><g:message code="reserva.dataReserva.label" default="Data Reserva" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: reservaInstance, field: 'dataReserva', 'errors')}">
                                    <g:datePicker name="dataReserva" precision="day" value="${reservaInstance?.dataReserva}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="idItem"><g:message code="reserva.idItem.label" default="Id Item" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: reservaInstance, field: 'idItem', 'errors')}">
                                    <g:textField name="idItem" value="${fieldValue(bean: reservaInstance, field: 'idItem')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="tipo"><g:message code="reserva.tipo.label" default="Tipo" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: reservaInstance, field: 'tipo', 'errors')}">
                                    <g:textField name="tipo" value="${reservaInstance?.tipo}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="titulo"><g:message code="reserva.titulo.label" default="Titulo" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: reservaInstance, field: 'titulo', 'errors')}">
                                    <g:textField name="titulo" value="${reservaInstance?.titulo}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="username"><g:message code="reserva.username.label" default="Username" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: reservaInstance, field: 'username', 'errors')}">
                                    <g:textField name="username" value="${reservaInstance?.username}" />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
